package com.web.exiaodao.business.entity;

import com.web.webstart.base.entity.BaseEntity;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author eason
 * @ClassName: shop
 * @Description: 商品表定义表
 * @date 2016-11-02 17:35:34
 */
@Entity
@Table(name = "tb_xa_shop")
@ApiModel(value = "商品表定义表")
public class Shop extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品名称,商品名称")
    private String shopProductName;
    @ApiModelProperty(value = "商品价格,商品价格")
    private String shopProductPrice;
    @ApiModelProperty(value="商品原价,商品原价")
    private String originalPrice;
    @ApiModelProperty(value = "商品简介（产品参数）,商品简介（产品参数）简介，参数类别二合一的一个属性")
    private String shopProductBrief;
    @ApiModelProperty(value = "商品图片（banner）URL，多张逗号分割,商品图片URL，多张逗号分割")
    private String shopProductPicUrls;
    @ApiModelProperty(value = "商品介绍-图文详情-富文本,商品介绍-图文详情-富文本")
    private String shopProductIntroduce;
    @ApiModelProperty(value = "库存,库存")
    private Long shopProductInventory;
    @ApiModelProperty(value = "品牌,品牌(预留字段)")
    private String brand;
    @ApiModelProperty(value = "商品分类,商品种类")
    private Long categoryType;
    @ApiModelProperty(value = "点击量,点击量")
    private Long clickCont;
    @ApiModelProperty(value="排序值,排序值")
    private Long sort;
    @ApiModelProperty(value="抵扣比例,抵扣比例[0.01--1]")
    private Double discountRate;

    public static final long SORT_DEFAULT = 9999999L;//排序 default
    public static final double DISCOUNT_RATE_DEFAULT = 0;//抵扣比例 default

    public Shop() {
    }

    public void setShopProductName(String shopProductName) {
        this.shopProductName = shopProductName;
    }

    @Column(nullable = true, length = 100)
    public String getShopProductName() {
        return shopProductName;
    }

    public void setShopProductBrief(String shopProductBrief) {
        this.shopProductBrief = shopProductBrief;
    }

    @Column(nullable = true, length = 5000)
    public String getShopProductBrief() {
        return shopProductBrief;
    }

    public void setShopProductPicUrls(String shopProductPicUrls) {
        this.shopProductPicUrls = shopProductPicUrls;
    }

    @Column(nullable = true, length = 5000)
    public String getShopProductPicUrls() {
        return shopProductPicUrls;
    }

    public void setShopProductIntroduce(String shopProductIntroduce) {
        this.shopProductIntroduce = shopProductIntroduce;
    }

    @Column(nullable = true, length = 10000, columnDefinition = "MEDIUMTEXT")
    public String getShopProductIntroduce() {
        return shopProductIntroduce;
    }

    public void setCategoryType(Long categoryType) {
        this.categoryType = categoryType;
    }

    @Column(nullable = true, length = 50)
    public Long getCategoryType() {
        return categoryType;
    }

    public void setShopProductInventory(Long shopProductInventory) {
        this.shopProductInventory = shopProductInventory;
    }

    @Column(nullable = true, length = 50)
    public Long getShopProductInventory() {
        return shopProductInventory;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Column(nullable = true, length = 50)
    public String getBrand() {
        return brand;
    }

    @Column(nullable = true, length = 50)
    public String getShopProductPrice() {
        return shopProductPrice;
    }

    public void setShopProductPrice(String shopProductPrice) {
        this.shopProductPrice = shopProductPrice;
    }

    @Column(nullable = true, length = 50)
    public Long getClickCont() {
        return clickCont;
    }

    public void setClickCont(Long clickCont) {
        this.clickCont = clickCont;
    }

    @Column(nullable = true, length = 50)
    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    @Column(nullable = true, length = 50)
    public String getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(String originalPrice) {
        this.originalPrice = originalPrice;
    }

    @Column(nullable = true, length = 50)
    public Double getDiscountRate() {
        return discountRate;
    }

    public void setDiscountRate(Double discountRate) {
        this.discountRate = discountRate;
    }

    @Override
    public void setInsertBefore() {
        super.setInsertBefore();
        if (sort == null) {
            sort = SORT_DEFAULT;//排序默认值
        }
    }
}
